#include "mainwindow.h"
#include "./ui_mainwindow.h"

#include <QHostAddress>
#include <QHostInfo>


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //tcpClient = new QTcpSocket(this);    //创建socket变量
    //labSocketState=new QLabel("Socket状态：");  //状态栏标签
    //labSocketState->setMinimumWidth(250);
    //ui->statusBar->addWidget(labSocketState);

}

MainWindow::~MainWindow()
{
    delete ui;
}

// 连接tcp 回调函数
void MainWindow::on_ConnectButton_clicked()
{
     qDebug("Connect tcp...!!");
}


// ip输入回调函数
void MainWindow::on_lineEdit_ip_editingFinished()
{
    QString ip_str = ui->lineEdit_ip->text();//读取QLineEdit组件里输入的字符串
    if (ip_str.isEmpty())
    {
        return;
    }
    qDebug() << "Get new ip : "<< ip_str;

    // ip地址解析 add here

}


// port 端口号获取
void MainWindow::on_lineEdit_port_editingFinished()
{
    QString port_str = ui->lineEdit_port->text();//读取QLineEdit组件里输入的字符串
    if (port_str.isEmpty())
    {
         return;
    }


}

